<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="multipart/form-data;charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" th:href="@{../bootstrap/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{../css/font-awesome.min.css}">
    <link rel="stylesheet" th:href="@{../css/main.css}">

    <style>
        .tree li {
            list-style-type: none;
            cursor:pointer;
        }
        table tbody tr:nth-child(odd){background:#F4F4F4;}
        table tbody td:nth-child(even){color:#C00;}
        select,option{
           font-size: 20px;
        }
        .myModal-input{
            width: 200px;
            line-height: 30px;
            display: inline;
        }
        .modal-header{
            background-color: #6495ED;
        }
        .modal-dialog{
            width:900px;
        }
        .close{
            background-color: red;
        }
        .img{
            width:120px;
            height: 120px;
        }
        .imgDiv{
            position: absolute;
            left: 560px;

        }
        label{
            display: inline-block;
            min-width: 70px;/*或者 width: 100px;*/
        }
    </style>
</head>

<body>

<div th:replace="../templates/nav"></div>
<div class="container-fluid">
    <div class="row">
        <div th:replace="../templates/menu"></div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> 学员信息</h3>
                </div>
                <div class="panel-body">
                    <form class="form-inline" role="form" style="float:left;">
                        <div class="form-group has-feedback">
                            来源：<select name="resource" id="resource" class="form-control">
                            <option value="" selected="selected">请选择学生来源</option>
                            <option value="网上报名">网上报名</option>
                            <option value="经人介绍">经人介绍</option>
                            <option value="慕名而来">慕名而来</option>
                            <option value="线下报名">线下报名</option>
                            </select>
                            班级：<select name="cid" id="cid" class="form-control">


                                </select>
                            <div class="input-group">
                                <div class="input-group-addon">姓名</div>
                                <input class="form-control has-success" type="text" placeholder="请输入查询条件" id="stname">
                            </div>
                            <div class="input-group">
                                <div class="input-group-addon">学号</div>
                                <input class="form-control has-success" type="text" placeholder="请输入查询条件" id="sid">
                            </div>
                        </div>
                        <button type="button" class="btn btn-warning" id="btnSearch"><i class="glyphicon glyphicon-search"></i> 搜索</button>
                    </form>
                    <button type="button" class="btn btn-primary" style="float:right;" data-toggle="modal" data-target="#myModal5"><i class="glyphicon glyphicon-plus"></i> 新增</button>
                    <br>
                    <hr style="clear:both;">
                    <div class="table-responsive">
                        <form id="delForm">
                        <table class="table  table-bordered">
                            <thead>
                            <tr >
                                <th>姓名</th>
                                <th>学号</th>
                                <th>方向</th>
                                <th>班级</th>
                                <th>状态</th>
                                <th>性别</th>
                                <th>年龄</th>
                                <th>学历</th>
                                <th>毕业院校</th>
                                <th>专业</th>
                                <th width="100">操作</th>
                            </tr>
                            </thead>
                            <tbody id="tbody">

                            </tbody>

                            <tfoot>
                            <tr >
                                <td colspan="12" align="center">
                                    <ul class="pagination" id="byPage">

                                    </ul>
                                </td>

                            </tr>
                            </tfoot>
                        </table>
                        </form>
                    </div>
                </div>
            </div>

            <!-- 模态框（Modal）修改学生信息-->
            <form id="permissionSaveForm" enctype="multipart/form-data">
                <div class="modal fade myModel" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                <h4 class="modal-title" id="myModalLabel">修改学员基本信息</h4>
                            </div>
                            <input type="hidden" name="sid" id="sid2">
                            <div class="modal-body">
                                <div class="form-group">
                                    <label for="stname1">姓名：</label><input name="stname" id="stname1" class="form-control myModal-input">
                                    <label for="sid1">学号：</label><input name="sid" id="sid1" class="form-control myModal-input">
                                </div>
                                <div class="form-group imgDiv">
                                    <label for="icon">照片：</label><img name="icon" id="icon" class="img">
                                </div>
                                <div class="form-group">
                                    <label for="cid1">班级：</label><input name="cid" id="cid1" class="form-control myModal-input">
                                    <label for="uphone">电话号码：</label><input name="uphone" id="uphone" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="sex">性别：</label><input name="sex" id="sex" class="form-control myModal-input">
                                    <label for="sstate">最新状态：</label><input name="sstate" id="sstate" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="qq">QQ：</label><input name="qq" id="qq" class="form-control myModal-input">
                                    <label for="resource1">来源：</label><input name="resource" id="resource1" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="sos">联系人：</label><input name="sos" id="sos" class="form-control myModal-input">
                                    <label for="sosphone">紧急电话：</label><input name="sosphone" id="sosphone" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="un">学校：</label><input name="un" id="un" class="form-control myModal-input">
                                    <label for="degree">学历：</label><input name="degree" id="degree" class="form-control myModal-input">
                                    <label for="specialty">专业：</label><input name="specialty" id="specialty" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="sfz">身份证号：</label><input name="sfz" id="sfz" class="form-control myModal-input">
                                    <label for="age">年龄：</label><input name="age" id="age" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="file1">选择照片</label><input name="file1" id="file1" type="file" class="form-control">
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                <button type="button" class="btn btn-primary" id="btnSave">提交更改</button>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal-dialog -->
                </div>
            </form>

            <!-- 模态框（Modal）查看学生信息-->
            <form id="permissionLookForm">
                <div class="modal fade myModel" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                <h4 class="modal-title" id="myModalLabel1">查看学员基本信息</h4>
                            </div>
                            <input type="hidden" name="sid" id="sid3">
                            <div class="modal-body">
                                <div class="form-group">
                                    <label for="stname4">姓名：</label>
                                    <input name="stname" id="stname4" class="form-control myModal-input">
                                    <label for="sid4">学号：</label><input name="sid" id="sid4" class="form-control myModal-input">
                                </div>
                                <div class="form-group imgDiv">
                                    <label for="icon4">照片：</label><img name="icon" id="icon4" class="img">
                                </div>
                                <div class="form-group">
                                    <label for="cid4">班级：</label><input name="cid" id="cid4" class="form-control myModal-input">
                                    <label for="uphone4">电话号码：</label><input name="uphone" id="uphone4" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="sex4">性别：</label><input name="sex" id="sex4" class="form-control myModal-input">
                                    <label for="sstate4">最新状态：</label><input name="sstate" id="sstate4" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="qq4">QQ：</label><input name="qq" id="qq4" class="form-control myModal-input">
                                    <label for="resource4">来源：</label><input name="resource" id="resource4" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="sos4">联系人：</label><input name="sos" id="sos4" class="form-control myModal-input">
                                    <label for="sosphone4">紧急电话：</label><input name="sosphone" id="sosphone4" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="un4">学校：</label><input name="un" id="un4" class="form-control myModal-input">
                                    <label for="degree4">学历：</label><input name="degree" id="degree4" class="form-control myModal-input">
                                    <label for="specialty4">专业：</label><input name="specialty" id="specialty4" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="sfz4">身份证号：</label><input name="sfz" id="sfz4" class="form-control myModal-input">
                                    <label for="age4">年龄：</label><input name="age" id="age4" class="form-control myModal-input">
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal-dialog -->
                </div>
            </form>

            <!-- 模态框（Modal）新增学生信息-->
            <form id="permissionAddForm" enctype="multipart/form-data">
                <div class="modal fade myModel" id="myModal5" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                <h4 class="modal-title" id="myModalLabel5">增加学员</h4>
                            </div>
                            <div class="modal-body">
                                <div class="form-group">
                                    <label for="stname5">姓名：</label><input name="stname" id="stname5" class="form-control myModal-input">
                                    <label for="age5">年龄：</label><input name="age" id="age5" class="form-control myModal-input">
                                </div>
                                <div class="form-group">
                                    <label for="cid5">班级：</label>
                                    <select name="cid" id="cid5" class="form-control myModal-input">


                                </select>
<!--                                    <label for="cid5">班级：</label><input name="cid" id="cid5" class="form-control myModal-input">-->
                                    <label for="sex5">性别：</label><input name="sex" id="sex5" class="form-control myModal-input">
<!--                                    <label for="resource5">来源：</label><input name="resource" id="resource5" class="form-control myModal-input">-->
                                    <label for="resource5">来源：</label><select name="resource" id="resource5" class="form-control myModal-input">
                                    <option value="" selected="selected">请选择学生来源</option>
                                    <option value="网上报名">网上报名</option>
                                    <option value="经人介绍">经人介绍</option>
                                    <option value="慕名而来">慕名而来</option>
                                    <option value="线下报名">线下报名</option>
                                </select>
                                </div>
                                <div class="form-group">
                                    <label for="file">选择照片</label><input name="file" id="file" type="file" class="form-control">
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                <button type="button" class="btn btn-primary" id="btnAdd">保存</button>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal-dialog -->
                </div>
            </form>

        </div>
    </div>
</div>
<script th:src="@{../jquery/jquery.min.js}"></script>
<script th:src="@{../jquery/jquery-2.1.1.min.js}"></script>
<script th:src="@{|/jquery/jquery.md5.js|}"></script>
<script th:src="@{../bootstrap/js/bootstrap.min.js}"></script>
<script th:src="@{../script/docs.min.js}"></script>
<script th:src="@{../jquery/qrcode.min.js}"></script>
<script th:src="@{../layer/layer.js}"></script>
<script type="text/javascript">
    $(function () {
        $(".list-group-item").click(function(){
            if ( $(this).find("ul") ) {
                $(this).toggleClass("tree-closed");
                if ( $(this).hasClass("tree-closed") ) {
                    $("ul", this).hide("fast");
                } else {
                    $("ul", this).show("fast");
                }
            }
        });
        $("#btnSearch").click(function () {
            var username = /^[\u4E00-\u9FA5A-Za-z]{0,16}$/;
            console.log($("#stname").val())
            if(!username.test($("#stname").val())){
                layer.msg("学生姓名只能输入中文和英文,长度需要为0-16位", {time: 1000, icon: 5, shift: 6}, function () {
                });
                return;
            };
            showList(1);
        });
        showList(1);
    });

    $(function () {
        url1 = "/clazz/clazzDo";
        $.get(url1,"",function (data){
            if(data.result){
                var htmldata1 = "";
                htmldata1 = htmldata1 + "<option name='' value='' >请选择班级</option>";
                $.each(data.clazzList,function(index,clazz){
                    htmldata1 = htmldata1 + "<option name='cid' value="+clazz.cid+" >"+clazz.cname+"</option>";
                })
                $("#cid").html(htmldata1);
            }
        })
    });

    $(function () {
        url1 = "/clazz/clazzDo";
        $.get(url1,"",function (data){
            if(data.result){
                var htmldata1 = "";
                htmldata1 = htmldata1 + "<option name='' value='' >请选择班级</option>";
                $.each(data.clazzList,function(index,clazz){
                    htmldata1 = htmldata1 + "<option  value="+clazz.cid+" >"+clazz.cname+"</option>";
                })
                $("#cid5").html(htmldata1);
            }
        })
    });

    //查找一个学生信息
    function edit(sid){
        $("#sid2").val(sid),
        $.ajax({
            url: "/student/edit",
            type: "post",
            data: {"sid": sid},
            success: function (data) {
                if (data.result) {
                    $("#stname1").val(data.student.stname);
                    $("#sid1").val(data.student.sid);
                    $("#cid1").val(data.student.cid);
                    $("#uphone").val(data.student.uphone);
                    $("#sex").val(data.student.sex);
                    $("#icon").attr("src",data.student.icon);
                    $("#sstate").val(data.student.sstate);
                    $("#qq").val(data.student.qq);
                    $("#sex").val(data.student.sex);
                    $("#resource1").val(data.student.resource);
                    $("#sos").val(data.student.sos);
                    $("#sosphone").val(data.student.sosphone);
                    $("#un").val(data.student.un);
                    $("#degree").val(data.student.degree);
                    $("#specialty").val(data.student.specialty);
                    $("#sfz").val(data.student.sfz);
                    $("#age").val(data.student.age);
                } else {
                    layer.msg("修改失败", {time: 1000, icon: 5}, function () {
                    });
                }
            }
        });
    }

    //删除按钮点击事件
    function del(sid){
            $.ajax({
                url: "/student/delDo",
                type: "post",
                data: {"sid": sid},
                success: function (data) {
                    if (data.result) {
                        layer.msg("删除成功", {time: 1000, icon: 4}, function () {
                            location.href="/student/list";
                        });
                    } else {
                        layer.msg("删除失败", {time: 1000, icon: 5}, function () {
                        });
                    }
                }
            });
    }

    //编辑完成保存按钮点击事件
    $("#btnSave").click(function () {
        var formdata = new FormData($("#permissionSaveForm")[0]);
        var username = /^[\u4E00-\u9FA5A-Za-z]{2,16}$/;
        console.log($("#stname1").val())
        if(!username.test($("#stname1").val())){
            layer.msg("学生姓名只能输入中文和英文,长度需要为2-16位", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        };
        var userFile=/\.([jJ][pP][gG]){1}$|bai\.([jJ][pP][eE][gG]){1}$|\.([gG][iI][fF]){1}$|\.([pP][nN][gG]){1}$|\.([bB][mM][pP]){1}$/;
        if(!userFile.test( $("#file1").val())){
            layer.msg("只能上传图片文件", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        var ss=$("#sex").val();
        var sex=/^(男|女)$/;
        if(!sex.test(ss)){
            layer.msg("性别请输入男或女", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        var rr=$("#resource1").val();
        var resource=/^(网上报名|经人介绍|慕名而来|线下报名)$/;
        if(!resource.test(rr)){
            layer.msg("来源请输入“网上报名”或“经人介绍”或“慕名而来”或“线下报名”。", {time: 5000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        var uu=$("#uphone").val();
        var uphone=/^1[3456789]\d{9}$/;
        if(!uphone.test(uu)){
            layer.msg("请输入正确的手机号", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        var qq=$("#qq").val();
        var qqq=/^[1-9][0-9]{4,14}$/;
        if(!qqq.test(qq)){
            layer.msg("请输入正确的qq号", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        var sos=$("#sosphone").val();
        var sosphone=/^1[3456789]\d{9}$/;
        if(!sosphone.test(sos)){
            layer.msg("请在紧急联系人栏输入正确的手机号", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        var ff=$("#sfz").val();
        var sfz= /^(\d{18,18}|\d{15,15}|\d{17,17}X)$/;
        if(!sfz.test(ff)){
            layer.msg("请输入正确的身份证号", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        $.ajax({
            url: "/student/editDo1",
            type: "post",
            dataType:"json",
            async:false,
            cache:false,
            contentType:false,
            processData:false,
            data: formdata,
            success: function (msg) {
                if (msg) {
                    layer.msg("保存成功", {time: 1000, icon: 4}, function () {
                        location.href = "/student/list";
                    });
                }
            }
        });
    });

    //查找一个学生信息
    function select(sid){
        $("#sid3").val(sid),
            $.ajax({
                url: "/student/edit",
                type: "post",
                data: {"sid": sid},
                success: function (data) {
                    if (data.result) {
                        $("#stname4").val(data.student.stname);
                        $("#sid4").val(data.student.sid);
                        $("#cid4").val(data.student.cid);
                        $("#uphone4").val(data.student.uphone);
                        $("#sex4").val(data.student.sex);
                        $("#icon4").attr("src",data.student.icon);
                        $("#sstate4").val(data.student.sstate);
                        $("#qq4").val(data.student.qq);
                        $("#sex4").val(data.student.sex);
                        $("#resource4").val(data.student.resource);
                        $("#sos4").val(data.student.sos);
                        $("#sosphone4").val(data.student.sosphone);
                        $("#un4").val(data.student.un);
                        $("#degree4").val(data.student.degree);
                        $("#specialty4").val(data.student.specialty);
                        $("#sfz4").val(data.student.sfz);
                        $("#age4").val(data.student.age);
                    }
                }
            });
    }

    //分页展示
    function showList(currentPage) {
        var sid = $("#sid").val();
        var sid2 = sid.replace("wnxy","");
        $.ajax({
            url:"/student/listDo",
            type:"get",
            data:{"currentPage":currentPage,"stname":$("#stname").val(),"resource":$("#resource").val(),"cid":$("#cid").val(),"sid":sid2},
            success:function (data) {
                if (data.result){
                    var str="";
                    $.each(data.studentList, function (index, student) {
                        str += "<tr>";
                        str += "<td>" + student.stname + "</td>";
                        str += "<td>wnxy" + student.sid + "</td>";
                        str += "<td>" + student.clazz.cname + "</td>";
                        str += "<td>" + student.cid + "</td>";
                        str += "<td>" + student.sstate + "</td>";
                        str += "<td>" + student.sex + "</td>";
                        str += "<td>" + student.age + "</td>";
                        str += "<td>" + student.degree + "</td>";
                        str += "<td>" + student.un + "</td>";
                        str += "<td>" + student.specialty + "</td>";
                        str += "<td>";
                            str += '<button type="button" class="btn btn-success btn-xs" data-toggle="modal" data-target="#myModal1" onclick="select(' + student.sid + ')"><i class=" glyphicon glyphicon-check"></i></button>';
                            str += '<button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#myModal" onclick="edit(' + student.sid + ')"><i class=" glyphicon glyphicon-pencil"></i></button>';
                        str += '<button type="button" class="btn btn-danger btn-xs" onclick="del(' + student.sid + ')"><i class=" glyphicon glyphicon-remove"></i></button>';
                        str += "</td>";
                        str += "</tr>";
                    });
                    $("#tbody").html(str);
                    var pageStr = "";
                    pageStr += '<li class="' + (data.pageBean.currentPage == 1 ? 'disabled' : '') + '"><a href="#" onclick="showList(' + (data.pageBean.currentPage>1?data.pageBean.currentPage-1:1)+ ')">上一页</a></li>';
                    for (var i = 1; i <= data.pageBean.countPage; i++) {
                        pageStr += '<li class="' + (data.pageBean.currentPage == i ? 'active' : '') + '"><a href="#" onclick="showList(' + i + ')">' + i + '<span class="sr-only">(current)</span></a></li>';
                    }
                    pageStr += '<li class="' + (data.pageBean.currentPage == data.pageBean.countPage ? 'disabled' : '') + '"><a href="#" onclick="showList('+(data.pageBean.currentPage==data.pageBean.countPage?data.pageBean.countPage:data.pageBean.currentPage+1)+')">下一页</a></li>';
                    $("#byPage").html(pageStr);
                } else {
                    layer.msg("数据加载失败", {time: 1000, icon: 5, shift: 6}, function () {
                    });
                }
            }
        });
    }

    //增加按钮点击事件
    $("#btnAdd").click(function () {
        var formdata = new FormData($("#permissionAddForm")[0]);
            var username = /^[\u4E00-\u9FA5A-Za-z]{2,16}$/;
            console.log($("#stname5").val())
            if(!username.test($("#stname5").val())){
                layer.msg("学生姓名只能输入中文和英文,长度需要为2-16位", {time: 1000, icon: 5, shift: 6}, function () {
                });
                return;
        };
        var stname=$("#stname5").val();
        var age=$("#age5").val();

        // var cid=$("#cid5").val();
        // var cc=/^[1-9]\d*|0$/;
        // if(!cc.test(cid)){
        //     layer.msg("班级请输入班级编号：数字", {time: 2000, icon: 5, shift: 6}, function () {
        //     });
        //     return;
        // }
        var ss=$("#sex5").val();
        var sex=/^(男|女)$/;
        if(!sex.test(ss)){
            layer.msg("性别请输入男或女", {time: 2000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        // var rr=$("#resource5").val();
        // var resource=/^(网上报名|经人介绍|慕名而来|线下报名)$/;
        // if(!resource.test(rr)){
        //     layer.msg("来源请输入“网上报名”或“经人介绍”或“慕名而来”或“线下报名”。", {time: 5000, icon: 5, shift: 6}, function () {
        //     });
        //     return;
        // }
        var userFile=/\.([jJ][pP][gG]){1}$|bai\.([jJ][pP][eE][gG]){1}$|\.([gG][iI][fF]){1}$|\.([pP][nN][gG]){1}$|\.([bB][mM][pP]){1}$/;
        if(!userFile.test( $("#file").val())){
            layer.msg("只能上传图片文件", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        if(stname==null||stname==""){
            layer.msg("学生姓名不能为空", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        if(age==null||age==""){
            layer.msg("学生年龄不能为空", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        // if(cid==null||cid==""){
        //     layer.msg("学生班级不能为空", {time: 1000, icon: 5, shift: 6}, function () {
        //     });
        //     return;
        // }
        if(sex==null||sex==""){
            layer.msg("学生性别不能为空", {time: 1000, icon: 5, shift: 6}, function () {
            });
            return;
        }
        // if(resource==null||resource==""){
        //     layer.msg("学生来源不能为空", {time: 1000, icon: 5, shift: 6}, function () {
        //     });
        //     return;
        // }
        $.ajax({
            url: "/student/addDo",
            type: "post",
            dataType:"json",
            async:false,
            cache:false,
            contentType:false,
            processData:false,
            data: formdata,
            success: function (msg) {
                if (msg) {
                    layer.msg("保存成功", {time: 1000, icon: 4}, function () {
                        location.href = "/student/list";
                    });
                }
            }
        });
    });
</script>
</body>
</html>







